package com.bayern.muchen.blog.controller.management;

import com.bayern.muchen.blog.entity.Article;
import com.bayern.muchen.blog.service.management.ArticleManageService;
import com.bayern.muchen.blog.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author QIUYANG
 * @title: ArticleManageController
 * @description: 文章管理
 * @date 12/1/20214:47 PM
 */
@RestController
@RequestMapping("/article")
public class ArticleManageController {

    @Autowired
    ArticleManageService articleManageService;

    @PostMapping("/insert")
    public R insertArticle(@RequestBody Article article){
        int result = articleManageService.insertArticle(article);
        if (result==0){
            return R.error(-1,"添加失败");
        }
        return R.ok();
    }

}
